//
// Created by jsjxsy on 2022/8/17.
//
#include <iostream>
using namespace std;
void a() {
  throw "a() exception";
}
void g() noexcept {
  throw "g() exception";
}
void h() noexcept(noexcept(g())) {
  g();
}

void f(){

}
int main() {
  cout << "g():" << boolalpha << noexcept(g()) << endl;
  cout << "h():" << boolalpha << noexcept(h()) << endl;
  cout << "f():" << boolalpha << noexcept(f()) << endl;
  try{
    g();
  } catch (const exception &e) {
    cout<<e.what()<<endl;
  }
  try{
    a();
  } catch (const exception &e) {
    cout<<e.what()<<endl;
  }
  return 0;
}
